package cn.wolfcode.crm.mapper;


import cn.wolfcode.crm.domain.Role;
import cn.wolfcode.crm.qo.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RoleMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Role record);

    Role selectByPrimaryKey(Long id);

    List<Role> selectAll();

    int updateByPrimaryKey(Role record);

    int rows(QueryObject qo);

    List<Role> queryForList(QueryObject qo);

    void deleteRelation(Long id);

    void insertRelation(@Param("roleId") Long id, @Param("permissionId") Long permissId);

    void deleteRelationMenu(Long id);

    void insertRelationMenu(@Param("roleId") Long id, @Param("menuId") Long menuId);


    List<Role> selectByEmployeeId(Long id);

    Long[] selectPermissionById(Long id);

    Long[] selectMenuByRoleId(Long id);
}